import { obtainCourseReferral } from '../../../config/api'
import * as actionTypes from './actionTypes';

const getCourseReferral = (data) => ({
	type: actionTypes.Wrap_Switch_Status,
	data
});

// 获取 课程介绍
export const acquireCourseReferral = ( open_id, union_id ) => {
	return async (dispatch) => {
		const courseReferral = await obtainCourseReferral( open_id, union_id )
		console.log(courseReferral.data, '获取 课程介绍 数据')
		dispatch(getCourseReferral(courseReferral.data));
	}
};
// 获取 课程介绍
export const updateWrapSwitchStatus = (status) => {
	return async (dispatch) => {
		dispatch(getCourseReferral(status));
	}
};